// pages/home/index.js
Page({
  data:{
    list:[]
  },

  onLoad(){
    this.getHomeInfo()
  },

// 轮播图跳转
tiaozhuan(e){
  const index = e.mark.index
  console.log(index);
wx.navigateTo({
  url: '/pages/goods/index?id=' + this.data.list[1].data[index].link.param.query.goodsId,
})
},

  // 获取页面数据
  async getHomeInfo(){
  const {status,data} = await wx.http.get('/page/detail')
  if(status !==200) return wx.utils.toast()
  console.log(data.pageData.items);
  this.setData({list:data.pageData.items})
  },

  // 手机详情跳转
  tiaozhuan1(e){
    const index = e.mark.index
    wx.navigateTo({
      url: '/pages/goods/index?id=' + this.data.list[6].data[index].goods_id,
    })
  }
})